#pragma once
#include <sdl/SDL_rect.h>
#include <king/Engine.h>

namespace King {
	struct DiamondIndex
	{
	public:
		DiamondIndex()
			: col(0)
			, row(0)
		{}

		DiamondIndex(const int& c, const int& r)
			: col(c)
			, row(r)
		{}

		bool operator == (const DiamondIndex& index) const;
		bool operator != (const DiamondIndex& index) const;
		bool operator < (const DiamondIndex& index) const;
		bool isNeighborhood(const DiamondIndex& index) const;
		bool isValid() const;

		static DiamondIndex		NULLINDEX;

		int		col;
		int		row;
	};

	struct DiamondPoint
	{
		float	x;
		float	y;
	};

	struct DiamondRect
	{
		DiamondPoint	origin;
		float			w;
		float			h;
	};

	class Diamond
	{
	public:
		Diamond();
		Diamond(const DiamondIndex& index);
		~Diamond();

		DiamondPoint	getPosition() const;
		Engine::Texture	getColor() const;
		bool			containsPoint(const DiamondPoint& point);

		void			setIndex(const DiamondIndex& index);

	private:
		DiamondRect		mBBox;
		DiamondIndex	mIndex;
		Engine::Texture	mColor;
	};
}


